"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
    const { router, controller } = app;
    router.get("/", controller.home.index);
    /**
     * 登录注册接口
     * 注册--/zhuce
     * 查询--/chaxun
     * 登录--/denglu
     */
    router.post("/zhuce", controller.user.zhuce);
    router.get("/chaxun", controller.user.chaxun);
    router.post("/denglu", controller.user.denglu);
    /**
     * 前端vue渲染增删改查接口
     * 添加--/add
     * 删除--/remove
     * 修改--/changge
     * 查询--/check
     */
    router.get("/check", controller.contont.check);
    router.post("/add", controller.contont.add);
    router.delete("/remove", controller.contont.remove);
    router.put("/change", controller.contont.change);
    /**
     * 商品列表接口
     * 查询商品--/shop/inquire
     * 添加商品--/shop/add
     * 删除商品--/shop/remove
     * 修改商品--shop/alter
     */
    router.get("/shop/inquire", controller.shopping.inquire);
    router.post("/shop/add", controller.shopping.add);
    router.delete("/shop/remove", controller.shopping.remove);
    router.put("/shop/alter", controller.shopping.alter);
};
